package legway.tests;

import legway.*;
import lejos.nxt.Button;
import lejos.nxt.LCD;
import lejos.nxt.SensorPort;

/**
 * A class for testing the gyroscope.
 * Uses the offset (620) described in the HiTechnic gyroscope manual.
 * Prints the current gyro-value on the LCD with a sample rate of 5ms
 * 
 * @author Andreas Koefoed-Hansen, Tim Rasmussen, Kim Munk Petersen
 */
public class GyroTest {

	public static void main(String[] args) {
		/* Steven 
		GyroscopeSensor gyro = new GyroscopeSensor(SensorPort.S3);
		
		LCD.drawString("Gyro: ", 2, 1);
		LCD.drawString("Angle: ", 2, 2);
		
		while(!Button.ESCAPE.isPressed()) {
			LCD.drawInt((int)gyro.getAngleVelocity(), 5, 9, 1);
			LCD.drawInt((int)gyro.getAngle(), 5, 9, 2);
		}*/
		
		/* KIRK 
		GyroSensorKirk gyro = new GyroSensorKirk(SensorPort.S3);
		gyro.setZero();
		gyro.setZeroHeading();
		
		LCD.drawString("Gyro: ", 2, 1);
		LCD.drawString("Angle: ", 2, 2);
		
		while(!Button.ESCAPE.isPressed()) {
			LCD.drawInt((int)gyro.readValue(), 5, 9, 1);
			LCD.drawInt((int)gyro.readHeading(), 5, 9, 2);
		}*/
		
		/* VORES */
		GyroSensor gyro = new GyroSensor(SensorPort.S3);
		
		LCD.drawString("Gyro: ", 2, 1);
		LCD.drawString("Angle: ", 2, 2);
		
		while(!Button.ESCAPE.isPressed()) {
			LCD.drawInt((int)gyro.getAngularSpeed(), 5, 9, 1);
			LCD.drawInt((int)gyro.getAngle(), 5, 9, 2);
		}
	}
}
